//
//  GEEBaseNavigation.m
//  KX11UI
//
//  Created by LJQ on 2021/2/19.
//

#import "GEEBaseNavigation_HYC_Neusoft.h"

@interface GEEBaseNavigation_HYC_Neusoft ()

@end

@implementation GEEBaseNavigation_HYC_Neusoft



+ (void)load {
    UINavigationBar *appearance = [UINavigationBar appearance];
    
    // 设置文字属性
    
    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
    
    textAttrs[NSForegroundColorAttributeName] = UIColor.linkColor;
    
    textAttrs[NSFontAttributeName] = [UIFont boldSystemFontOfSize:18];
    
    // UIOffsetZero是结构体, 只要包装成NSValue对象, 才能放进字典\数组中
    
    // textAttrs[UITextAttributeTextShadowOffset] = [NSValue valueWithUIOffset:UIOffsetZero];
//    [appearance setBackgroundImage:[] forBarMetrics:UIBarMetricsDefault];
    [appearance setBarTintColor:UIColor.linkColor];
    [appearance setTitleTextAttributes:textAttrs];
    [appearance setShadowImage:[[UIImage alloc] init]];
    [appearance setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
    [appearance setTranslucent:false];
    
}


/// 设置标题字体样式
/// @param color 颜色
/// @param font 字体大小
-(void)navTitleConfig:(UIColor *)color font:(UIFont *)font {
    
    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
    
    textAttrs[NSForegroundColorAttributeName] = color;
    
    textAttrs[NSFontAttributeName] = font; //[UIFont boldSystemFontOfSize:18];
    
    [self.navigationBar setTitleTextAttributes:textAttrs];
}



//设置是否允许自动旋转
- (BOOL)shouldAutorotate {
    return YES;
}

//设置支持的屏幕旋转方向

- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
//    return self.interfaceOrientationMask;
    return self.supportedInterfaceOrientations;
}

//设置presentation方式展示的屏幕方向
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation {
  return self.interfaceOrientation;
}





- (void)viewDidLoad {
    [super viewDidLoad];
    
    // Do any additional setup after loading the view.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
